<?php
include 'D:/dingjiangbbs/common/home.php';

//屏蔽notice错误
error_reporting(E_ALL ^ E_NOTICE);

//接收post传值
//var_dump($_POST);

//判断是否勾选了选项
if (empty($_POST['$arr_reid'])) {

	exit('尚未勾选内容,请勾选选项再操作');
}

//接收id数组
$arr  = $_POST['$arr_reid'];
//var_dump($arr);

//分割id数组
$id = implode(',',$arr);
//var_dump($id);

//修改数据库isdel字段,恢复回复内容显示
if ($_POST['reply_rev'] == '恢复') {

	$table = DB_TABLE_DETAIL;
	$data  = [
		
		'isdel' => 0,
	];
	$where = "id in ($id)";
	$res   = update($link,$table,$data,$where);
	//var_dump($res);

	//输出,页面跳转
	if (!$res) {

		exit('<a href="'.WEB_SITE.'admin_cg.php?bighead=4&cg_number=10">操作失败,返回继续</a>');
	}

	echo '<a href="'.WEB_SITE.'admin_cg.php?bighead=4&cg_number=10">操作成功,返回继续</a>';
}

//删除数据库内容,删除回复内容
if ($_POST['reply_rev'] == '删除') {

	$table_r = DB_TABLE_DETAIL;
	$where_r = "id in ($id)";
	$res_r   = del($link,$table_r,$where_r);
	//var_dump($res_r);

	//输出及跳转页面
	if (!$res_r) {

		exit('<a href="'.WEB_SITE.'admin_cg.php?bighead=4&cg_number=10">操作失败,返回继续</a>');
	}

	echo '<a href="'.WEB_SITE.'admin_cg.php?bighead=4&cg_number=10">操作成功,返回继续</a>';
}

//关闭数据库连接
mysqli_close($link);